package com.yjt.javatest.entity.vo;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yjt.javatest.entity.User;
import com.yjt.javatest.entity.UserType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserVo {

    @TableId(type= IdType.AUTO)
    private Long userId;
    //用户名
    private String username;
    //姓名
    private String name;


    private String schoolId;//学工号
    @EnumValue
    private UserType type;
    /**
     * 邮箱 现在用不上
     */
    private String email;
    /**
     * 手机号
     */
    private String phoneNumber;
    public UserVo(User user) {
        this.userId = user.getUserId();
        this.name = user.getName();
        this.schoolId = user.getSchoolId();
        this.username = user.getUsername();
        this.email = user.getEmail();
    }


}
